import matplotlib.pyplot as plt
import numpy as np
from test0 import create_coordinate_system

# 创建一个坐标系
fig, ax = create_coordinate_system(x_range=(-2*np.pi, 2*np.pi), y_range=(-3,3))

# 添加一个sin(x) 的函数图像
x = np.linspace(0, np.pi, 100)
y = np.cos(x)

# 绘制cos(x) 的反函数图像 arccos x
x1 = np.linspace(-1, 1, 100)
y1 = np.arccos(x1)

ax.plot(x, y, linewidth=2, label='y = cos(x)', color='black', linestyle='--')
ax.plot(x1, y1, linewidth=2, label='y = arccos(x)', color='red')

ax.legend()
plt.show()
